import http from '@/utils/http.ts'
import {ConfigureDTO} from './entity/ConfigureDTO'
import {EntryDTO} from './entity/EntryDTO';
import {WorkStatus} from './entity/WorkStatus'

function getAllConfigure(): Promise<Array<ConfigureDTO>> {
    return http.request<Array<ConfigureDTO>>("/api/getAllConfigure", {});
}

function getConfigureAllNamespace(configure: ConfigureDTO): Promise<Array<ConfigureDTO>> {
    return http.request<Array<ConfigureDTO>>("/api/getConfigureAllNamespace", configure);
}


function getAllEntry(configure: ConfigureDTO): Promise<Array<EntryDTO>> {
    return http.request<Array<EntryDTO>>("/api/getAllEntry", configure);
}

function getWorkStatus(configure: EntryDTO): Promise<Array<WorkStatus>> {
    return http.request<Array<WorkStatus>>("/api/getWorkStatus", configure);
}

function clearWorkStatus(configure: EntryDTO): Promise<null> {
    return http.request<null>("/api/clearWorkStatus", configure);
}

export default {
    getAllConfigure,
    getAllEntry,
    getConfigureAllNamespace,
    getWorkStatus,
    clearWorkStatus
}